/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.baatar.opt.genetic.mutation;

import java.io.Serializable;
import org.baatar.opt.genetic.chromosome.IChromosome;
import org.baatar.util.RandomUtil;

/**
 * Interface for the mutation operators.
 * 
 * @author Ba
 */
public interface IMutator<T, M> extends Serializable, Cloneable {
    /**
     * Performs mutation operation according to the algorithm in the 
     * implementing class.
     * 
     * @param chromosome to be mutated.
     * @param mutationRatio ratio of the mutation operation to be performed.
     * @param random Randomization class to be used.
     * 
     * @return IChromosome<T, M> new mutated chromosome.
     */
    public IChromosome<T, M> mutate(IChromosome<T, M> chromosome,
                                    int iteration,
                                    float mutationRatio,
                                    RandomUtil random) throws CloneNotSupportedException;

    /**
     * Clones the this object.
     * 
     * @return Object new cloned object.
     * 
     * @throws CloneNotSupportedException is trown if this object doesnt
     * implements Cloneable interface.
     */
    public Object clone() throws CloneNotSupportedException;
}
